﻿@{
	Layout = null;
}

<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
	<link href="~/Assets/Admin/includes/normalize.css" rel="stylesheet" type="text/css" />
	<title>
		@String.Format("{0} - {1}", ViewBag.Title, SiteData.CarrotCakeCMSVersionMM)
	</title>

	@(new jquerybasic() { SelectedSkin = jquerybasic.jQueryTheme.LightGreen, UseJqueryMigrate = true })

	<link href="~/Assets/iCheck/iCheck.css" rel="stylesheet" />
	<link href="~/Assets/Admin/Includes/fauxstrap.css" rel="stylesheet" />
	<link href="~/Assets/Admin/Includes/chosen.min.css" rel="stylesheet" />
	<link href="~/Assets/Admin/includes/jquery.ui.timepicker.css" rel="stylesheet" type="text/css" />
	<link href="~/Assets/Admin/includes/modal.css" rel="stylesheet" type="text/css" />
	<link href="~/Assets/Admin/includes/mainpopup.css" rel="stylesheet" type="text/css" />
	<link href="~/Assets/Admin/includes/common.css" rel="stylesheet" type="text/css" />
	<link href="~/Assets/Admin/includes/TableStyles.css" rel="stylesheet" type="text/css" />

	<script src="~/Assets/iCheck/icheck.min.js"></script>
	<script src="~/Assets/Admin/Includes/icheck.init.js"></script>
	<script src="~/Assets/Admin/includes/jquery.ui.timepicker.js" type="text/javascript"></script>
	<script src="~/Assets/Admin/includes/base64.js" type="text/javascript"></script>
	<script src="~/Assets/Admin/includes/jquery.simplemodal.js" type="text/javascript"></script>
	<script src="~/Assets/Admin/includes/jquery.blockUI.js" type="text/javascript"></script>
	<script src="~/Assets/Admin/Includes/chosen.jquery.min.js"></script>
	@if (SecurityData.IsAuthenticated) {
		<script src="~/Assets/Admin/includes/common-utils.js" type="text/javascript"></script>
	}
	@if (SecurityData.IsAuthenticated) {
		<script type="text/javascript">

			$(document).ready(function () {
				AjaxBtnLoad();
			});

			$(document).ajaxComplete(function (event, xhr, settings) {
				AjaxBtnLoad();
			});
		</script>
	}
	@if (SecurityData.IsAuthenticated) {
	<!-- TinyMCE -->
		<script type="text/javascript" src="~/Assets/tiny_mce/tiny_mce.js"></script>
		<script type="text/javascript" src="~/Assets/Admin/includes/tinymce-config.js"></script>
		<script type="text/javascript">

			var pnl = '#divSavedAlert';
			var fld = '#hdnShowSaveLayer';
			var timer1 = '';

			function DisplaySaveBox() {

				if ($(fld).length < 1) {
					hideAlert();
				}

				if (timer1 != '') {
					clearTimeout(timer1);
				}

				if ($(fld).length > 0 && $(pnl).length > 0) {
					if ($(fld).val().length > 0) {
						$(pnl).css('display', '');
						timer1 = setTimeout(function () { hideAlert(); }, 3000);
					}

					$(fld).val('');
				}
			}

			function hideAlert() {
				if ($(pnl).length > 0) {
					$(pnl).css('display', 'none');
				}
			}

			var bTinyLoaded = false;
			function AjaxTinyLoad() {
				if (!bTinyLoaded) {
					TinyMCEParamInit("650", "400", true);
				}
				bTinyLoaded = true;
			}

			function AjaxScriptLoad() {

				AjaxTinyLoad();

				DisplaySaveBox();
			}

			$(document).ready(function () {
				AjaxScriptLoad();
			});
		</script>
	<!-- /TinyMCE -->
	}
	@RenderSection("scripts", required: false)
</head>
<body>
	<div id="divSavedAlert" class="info-saved" style="display: none;">
		<h2>
			@ViewBag.SavedPageAlertText
		</h2>
	</div>

	<h1 class="headingColor">
		@ViewBag.Title
	</h1>

	<div id="cmsAjaxMainDiv">
		<div id="ajaxUpdatePanel">
			@RenderBody()
		</div>
	</div>

	<div style="display: none">
		<input type="hidden" id="hdnShowSaveLayer" value="@ViewBag.SavedPageAlert" />

		<div id="cms-basic-modal-content">
			<div id="cmsModalFrame">
			</div>
		</div>

		<div style="display: none;">
			<img src="~/Assets/Admin/images/ui-anim_basic_16x16.gif" alt="anim_basic_16x16" />
			<img src="~/Assets/Admin/images/x.png" alt="x" />
			<img src="~/Assets/Admin/images/mini-spinner3-6F997D.gif" alt="spinner" />
			<img src="~/Assets/Admin/images/Ring-64px-A7B2A0.gif" alt="ring" />
			<img src="~/Assets/Admin/images/ani-smallbar.gif" alt="bar" />
		</div>

		<div id="divCMSModal" title="CarrotCake CMS">
			<div id="divCMSModalMsg">
				&nbsp;
			</div>
		</div>

		<div id="divCMSCancelWin" title="Quit Editor?">
			<p id="divCMSCancelWinMsg">
				Are you sure you want cancel?
			</p>
		</div>
	</div>
	@RenderSection("footer", required: false)

	<div>
		@{
			string partialView = Helper.InsertSpecialView(Helper.ViewLocation.AdminPopupFooter);
			if (!String.IsNullOrEmpty(partialView)) {
				@Html.Partial(partialView)
			}
		}
	</div>
</body>
</html>